package com.schx.budget.dto;

import com.schx.budget.config.FilePathConfig;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

/**
 * @Classname FileUploadDTO
 * @Description TODO
 * @Date 2021/2/3 16:06
 * @Created by cyh
 */
public class FileUploadDTO {


    private String username;
    private String uploadTime;
    private MultipartFile source;
    private File target;
    private String path=FilePathConfig.PATH;

    public FileUploadDTO(String fileName){
        this.target=new File(path+fileName);
    }

    public FileUploadDTO(String path,String fileName){
        this.target=new File(path+fileName);
        this.path=path;
    }

    public String getPath() {
        return path;
    }

    public File getTarget() {
        return target;
    }

    public String getUsername() {

        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUploadTime() {
        return uploadTime;
    }

    public void setUploadTime(String uploadTime) {
        this.uploadTime = uploadTime;
    }

    public MultipartFile getSource() {
        return source;
    }

    public void setSource(MultipartFile source) {
        this.source = source;
    }
}
